package services.impl;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import services.ExchangeFormatService;
import services.XMLService;
import entities.ItemCotizacion;
import entities.ListaPrecios;
import entities.PedidoVenta;
import entities.xml.ExchangeFormatEntity;
@Stateless
public class ExchangeFormatServiceBean implements ExchangeFormatService {

	@EJB
	private XMLService xmlService;
	
	@SuppressWarnings("rawtypes")
	@Override
	public Object fromEF(String xml, String alias, Class clase) {
		return xmlService.fromXML(xml, alias, clase);
	}
	
	@Override
	public String toEF(ExchangeFormatEntity efEntity) {
		return xmlService.toXML(efEntity);
	}
	
	@Override
	public String toEF(Object obj, ExchangeFormatEntity efEntity) {
		efEntity = (ExchangeFormatEntity) this.fromModelEntity(obj, efEntity);
		return this.toEF(efEntity);
	}

	@Override
	public Object toModelEntity(ExchangeFormatEntity efEntity) {
		return xmlService.toModelEntity(efEntity);
	}

	@Override
	public Object fromModelEntity(Object obj, ExchangeFormatEntity efEntity) {
		return xmlService.fromModelEntity(obj, efEntity);
	}

	@Override
	public List<ItemCotizacion> getItemsCotizacionFromEF(String str) {
		return xmlService.getItemsCotizacionFromXML(str);
	}

	public PedidoVenta getPedidoVenta(String xml){
		return xmlService.getPedidoVenta(xml);
	}

	@Override
	public List<ListaPrecios> getListasDePrecios(String strListas) {
		return xmlService.getListasDePrecios(strListas);
	}

}
